/*
 *      Created on: Mar 8, 2011
 *      Author: topcoder
 */
#include <VolumeFormatter.h>

VolumeFormatter::VolumeFormatter(const Volume &volume, Format format)
:volume_m(volume), format_m(format)
{
}

ostream& operator<<(ostream& os, const VolumeFormatter& volumeFormatter)
{

    if(volumeFormatter.format_m == FormatInBaseUnit)
    {
        (volumeFormatter.volume_m).PrintInFormat2(os);
    }
    else if(volumeFormatter.format_m == FormatInUnitOrder)
    {
        (volumeFormatter.volume_m).PrintInFormat1(os);
    }

    return os;
}


